ARG DOCKER_REGISTRY=docker.io
FROM ${DOCKER_REGISTRY}/openjdk:11.0.14.1-jdk-bullseye
ARG JAR_NAME=graph-analysis-web-1.0.0-SNAPSHOT.jar
ENV TZ=Asia/Shanghai
RUN useradd spring
COPY --chown=spring ${JAR_NAME} /app/
COPY --chown=spring entry-point.sh /app/bin/
RUN ln -s /app/${JAR_NAME} /app/application.jar && chmod 744 /app/bin/entry-point.sh
USER spring
WORKDIR  /app
CMD ["/app/bin/entry-point.sh"]
